﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Array
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] numbers = { 12, 5, 6, 7, 8, 9, 88 };

            int max = numbers[0];
            int min = numbers[0];
            int sum = 0;

            // 遍历数组计算最大值、最小值和总和
            for (int i = 0; i < numbers.Length; i++)
            {
                if (numbers[i] > max)
                {
                    max = numbers[i];
                }
                if (numbers[i] < min)
                {
                    min = numbers[i];
                }
                sum += numbers[i];
            }

            // 计算平均值
            double average = (double)sum / numbers.Length;

            Console.WriteLine("最大值: " + max);
            Console.WriteLine("最小值: " + min);
            Console.WriteLine("总和: " + sum);
            Console.WriteLine("平均值: " + average);
        }
    }
}
